Add example of adding Unicode replacements in README
authorjustbur <justin@burkett.cc>
Wed, 4 Nov 2015 01:03:29 +0000 (20:03 -0500)
committerjustbur <justin@burkett.cc>
Wed, 4 Nov 2015 01:03:29 +0000 (20:03 -0500)
Thanks @epitzer for the suggestion.
https://github.com/justbur/emacs-which-key/issues/52

README.org

index a9a70d8c3f2161a1f42e6f07fcc91162c67b0061..8e56c9dbcf60ee03e85c4a7623d4e098cf3ecb79 100644 (file)
@@ -277,11 +277,16 @@ match. The replacements do not need to use regexp and can be as simple as
 ("left" . "lft")
 #+END_SRC
 
-You can add this element to the key list with (there are no helper functions for
-these alists)
+Here is an example of using key replacement to include Unicode characters in the
+results. Unfortunately, using Unicode characters may upset the alignment of the
+which-key buffer, because Unicode characters can have different widths even in a
+monospace font and alignment is based on character width.
 
 #+BEGIN_SRC Emacs-lisp
-(add-to-list 'which-key-key-replacement-alist '("left" . "lft"))
+(add-to-list 'which-key-key-replacement-alist '("TAB" . "↹"))
+(add-to-list 'which-key-key-replacement-alist '("RET" . "⏎"))
+(add-to-list 'which-key-key-replacement-alist '("DEL" . "⇤"))
+(add-to-list 'which-key-key-replacement-alist '("SPC" . "␣"))
 #+END_SRC
 
 *** Sorting Options